import React from 'react';
// 以下文件格式为描述路由的协议格式
// 你可以调整 routerConfig 里的内容
// 变量名 routerConfig 为 iceworks 检测关键字，请不要修改名称

// import UserLayout from './layouts/UserLayout';
// const UserLogin = React.lazy(() => import('./pages/UserLogin'));
// const UserRegister = React.lazy(() => import('./pages/UserRegister'));
import BasicLayout from './layouts/BasicLayout';
import Dashboard from './pages/Dashboard';
const LowerMachine = React.lazy(() => import('./pages/LowerMachine'));
const LowerMachineOperationPage = React.lazy(() => import('./pages/LowerMachine/components/OperationPage'));
const MetricGroup = React.lazy(() => import('./pages/MetricGroup'));
const BindMetric = React.lazy(() => import('./pages/MetricGroup/components/BindMetric'));
const Metric = React.lazy(() => import('./pages/Metric'));
const JobManagement = React.lazy(() => import('./pages/JobManagement'));
const MonitorData = React.lazy(() => import('./pages/MonitorData'));
const Device = React.lazy(() => import('./pages/Device'));
const BindMetricGroup = React.lazy(() => import('./pages/Device/components/BindMetricGroup'));
const DeviceOperationPage = React.lazy(() => import('./pages/Device/components/OperationPage'));
const MonitorPage = React.lazy(() => import('./pages/Device/components/MonitorPage'));
const MonitorDataChartViewPage = React.lazy(() => import('./pages/Device/components/ChartViewPage'));
const MonitorDataCachePage = React.lazy(() => import('./pages/Device/components/CacheDataPage'));
const ConnectionPool = React.lazy(() => import('./pages/ConnectionPool'));
// const ClusterApp = React.lazy(() => import('./pages/ClusterApp'));
const Policy = React.lazy(() => import('./pages/Policy'));
const Expression = React.lazy(() => import('./pages/Expression'));
const Event = React.lazy(() => import('./pages/Event'));
const Manual = React.lazy(() => import('#/pages/Manual'));
const ActuatorEnv = React.lazy(() => import('./pages/ActuatorEnv'));
const ActuatorMetrics = React.lazy(() => import('./pages/ActuatorMetrics'));

const NotFound = React.lazy(() => import('./pages/NotFound'));
const Forbidden = React.lazy(() => import('./pages/_403Forbidden'));
// import Graph from './pages/Graph';
// import GraphEditor from './pages/Graph/components/Editor';
const routerConfig = [
  // {
  //   path: '/',
  //   layout: UserLayout,
  //   component: UserLogin,
  // },
  // {
  //   path: '/user/login',
  //   layout: UserLayout,
  //   component: UserLogin,
  // },
  // {
  //   path: '/user/register',
  //   layout: UserLayout,
  //   component: UserRegister,
  // },
  {
    path: '/dashboard',
    layout: BasicLayout,
    component: Dashboard,
    name: '仪表盘',
  },
  {
    path: '/manage/lowermachine',
    layout: BasicLayout,
    component: LowerMachine,
    name: '网关管理',
    children: [
      {
        path: '/:code/operation',
        layout: BasicLayout,
        component: LowerMachineOperationPage,
        name: '管理',
      },
    ]
  },
  {
    path: '/manage/device',
    layout: BasicLayout,
    component: Device,
    name: '设备管理',
    children: [
      {
        path: '/:code/monitor',
        layout: BasicLayout,
        component: MonitorPage,
        name: '设备监控',
      },
      {
        path: '/:code/bindmetricgroups',
        layout: BasicLayout,
        component: BindMetricGroup,
        name: '绑定指标组',
      },
      {
        path: '/:code/operation',
        layout: BasicLayout,
        component: DeviceOperationPage,
        name: '管理',
      },
      {
        path: '/:code/chartview',
        layout: BasicLayout,
        component: MonitorDataChartViewPage,
        name: '数据视图',
      },
      {
        path: '/:code/cache',
        layout: BasicLayout,
        component: MonitorDataCachePage,
        name: '最新数据',
      },
    ]
  },
  {
    path: '/manage/metricgroup',
    layout: BasicLayout,
    component: MetricGroup,
    name: '指标组管理',
    children: [
      {
        path: '/:code/bindmetrics',
        layout: BasicLayout,
        component: BindMetric,
        name: '绑定指标',
      },
    ]
  },
  {
    path: '/manage/metric',
    layout: BasicLayout,
    component: Metric,
    name: '指标管理',
  },
  {
    path: '/collection/job',
    layout: BasicLayout,
    component: JobManagement,
    name: '任务管理',
  },
  {
    path: '/collection/monitor',
    layout: BasicLayout,
    component: MonitorData,
    name: '监控数据',
  },
  {
    path: '/devops/connectionpool',
    layout: BasicLayout,
    component: ConnectionPool,
    name: '连接池管理',
  },
  // {
  //   path: '/devops/cluster',
  //   layout: BasicLayout,
  //   component: ClusterApp,
  //   name: '服务集群管理',
  // },
  {
    path: '/devops/actuator/:feature',
    layout: BasicLayout,
    component: ActuatorEnv,
    name: '服务状态',
  },
  {
    path: '/devops/actuator/metrics/tree',
    layout: BasicLayout,
    component: ActuatorMetrics,
    name: '应用监控信息',
  },
  {
    path: '/alarm/policy',
    layout: BasicLayout,
    component: Policy,
    name: '策略管理',
  },
  {
    path: '/alarm/expression',
    layout: BasicLayout,
    component: Expression,
    name: '策略表达式管理',
  },
  {
    path: '/alarm/event',
    layout: BasicLayout,
    component: Event,
    name: '事件管理',
  },
  {
    path: '/manual',
    layout: BasicLayout,
    component: Manual,
    name: '用户手册',
  },
  // {
  //   path: '/devops/graph',
  //   layout: BasicLayout,
  //   component: Graph,
  //   name: '组态管理',
  // },
  // {
  //   path: '/devops/graph/editor',
  //   layout: BasicLayout,
  //   component: GraphEditor,
  //   name: '组态编辑',
  // },

  {
    path: '/403',
    layout: BasicLayout,
    component: Forbidden,
  },
  {
    path: '*',
    layout: BasicLayout,
    component: NotFound,
  },
];

export default routerConfig;
